package com.ware4u.fx.news.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.ware4u.fx.news.entity.News;

import java.util.List;

public interface NewsRepository extends JpaRepository<News, Long>, JpaSpecificationExecutor<News> {
	
	/**
	 * 根据板块查找新闻
	 * @param catalog
	 * @return
	 */
	Page<News> findByCatalog(String catalog, Pageable pageable);

	/**
	 * 模糊查询标题展示下拉选
	 * @param title 标题
	 * @return Page<News>
	 */
	List<News> findByTitleContaining(String title);

}
